package com.atguigu.practice;

import java.util.Scanner;

public class PalindromeTest {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String s1=scanner.next();
        String s2=scanner.next();
        int res=0;
        StringBuilder sb=new StringBuilder();
        //写一个方法，判断字符串是否是回文串
        for(int i=0;i<s1.length();i++){
            int j=0;
            sb=new StringBuilder();
            while(j<i){
                sb.append(s1.charAt(j));
                j++;
            }
            for(int k=0;k<s2.length();k++){
                sb.append(s2.charAt(k));
            }
            while(j<s1.length()){
                sb.append(s1.charAt(j));
                j++;
            }
            if(checkPalindrome(sb.toString())){
                res++;
            }
        }
        System.out.println(res);
    }

    private static boolean checkPalindrome(String s1) {
        StringBuilder sb=new StringBuilder(s1);
        if(sb.reverse().toString().equals(s1)){
            return true;
        }else{
            return false;
        }
    }
}
